﻿using SmartSiteManagementSystem.Models.Enums;
using System;

namespace SmartSiteManagementSystem.Models.User

{
    [Serializable]
    public class UserInfo
    {
        #region Model
        private int _userid;
        /// <summary>
        /// 用户自增Id
        /// </summary>
        public int UserId
        {
            set { _userid = value; }
            get { return _userid; }
        }

        private String _logonname = String.Empty;
        /// <summary>
        /// <para>登陆名</para>
        /// </summary>
        public String LogonName
        {
            get { return _logonname; }
            set { _logonname = value; }
        }

        private String _logonpwd = String.Empty;
        /// <summary>
        /// <para>密码</para>
        /// </summary>
        public String LogonPwd
        {
            get { return _logonpwd; }
            set { _logonpwd = value; }
        }

        /// <summary>
        /// <para>显示姓名</para>
        /// </summary>
        public String ShowName { get; set; }

        private String _email = String.Empty;
        /// <summary>
        /// <para>邮箱</para>
        /// </summary>
        public String Email
        {
            get { return _email; }
            set { _email = value; }
        }
    

        private String _mobile = String.Empty;
        /// <summary>
        /// <para>手机号</para>
        /// </summary>
        public String Mobile
        {
            get { return _mobile; }
            set
            {
                _mobile = value;
            }
        }

        /// <summary>
        /// <para>头像  保留字段 看情况是否做图片系统</para>
        /// </summary>
        public String HeadPic { get; set; }

        private Int16 _sex = 0;
        /// <summary>
        /// <para>性别字段 1男 2女 0未知</para>
        /// </summary>
        public Int16 Sex
        {
            get { return _sex; }
            set { _sex = value; }
        }

        private Int32 _postiontype = 0;
        /// <summary>
        /// 岗位 1 吊车司机
        /// </summary>
        public Int32 PositionType
        {
            get { return _postiontype; }
            set { _postiontype = value; }
        }

        private Int32 _regtype = 0;
       /// <summary>
       /// 
       /// </summary>
        public Int32 RegType
        {
            get { return _regtype; }
            set { _regtype = value; }
        }

        private String _regip = String.Empty;
        /// <summary>
        /// <para>注册IP</para>
        /// </summary>
        public String RegIp
        {
            get { return _regip; }
            set { _regip = value; }
        }



        private DateTime _createtime = DateTime.Now;
        /// <summary>
        /// <para>创建时间</para>
        /// </summary>
        public DateTime CreateTime
        {
            get { return _createtime; }
            set { _createtime = value; }
        }

        public string CreateTimeStr { get { return _createtime.ToString("yyyy-MM-dd HH:mm:ss"); } }

        private String _lastestlogonip = String.Empty;
        /// <summary>
        /// <para>最后登陆IP</para>
        /// </summary>
        public String LastestLogonIp
        {
            get { return _lastestlogonip; }
            set { _lastestlogonip = value; }
        }
       
        private DateTime _lastestlogontime = DateTime.Now;
        /// <summary>
        /// <para>最后登陆时间</para>
        /// </summary>
        public DateTime LastestLogonTime
        {
            get { return _lastestlogontime; }
            set { _lastestlogontime = value; }
        }

        public string LastestLogonTimeStr { get { return _lastestlogontime.ToString("yyyy-MM-dd HH:mm:ss"); } }
        
        private Int32 _logincount = 0;
        /// <summary>
        /// <para>登陆次数</para>
        /// </summary>
        public Int32 LoginCount
        {
            get { return _logincount; }
            set { _logincount = value; }
        }
        
        
        private Boolean _isStop = false;
        /// <summary>
        /// <para>帐号停用标识</para>
        /// </summary>
        public Boolean IsStop
        {
            get { return _isStop; }
            set { _isStop = value; }
        }

        private Boolean _isDeleteflag = false;
        /// <summary>
        /// <para>删除标识</para>
        /// </summary>
        public Boolean IsDelete
        {
            get { return _isDeleteflag; }
            set { _isDeleteflag = value; }
        }
        #endregion

        #region 扩展、虚拟字段等
        /// <summary>
        /// [虚拟字段]注册类型名称
        /// </summary>
        public string RegTypeName { get { return ((EUserRegLogonNameType)_regtype).ToString(); } }



        /// <summary>
        /// [虚拟字段]岗位类型名称
        /// </summary>
        public string PositionTypeName { get { return ((EUserPositionType)_postiontype).ToString(); } }

        #endregion 
    }
}
